<h1>
  Welcome hola hello tonces

  <% if user_signed_in? %>
    <li><%= current_user.email %></li>
    <li> <%= link_to "log out!",destroy_user_session_path,:method=>:delete  %> </li>
  <% else %>
    <li><%= link_to "Sing in!", new_user_session_path %></li>
  <% end %>
</h1>
<h1>Listing products</h1>

<table >
  <tr>
    <th>Name</th>
    <th>Description</th>
    <th>History</th>
    <th>Quantity</th>
    <th>Cockpitcost</th>
    <th>Sellercost</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @products.each do |product| %>
  <tr>
    <td><%= product.name %></td>
    <td><%= product.description %></td>
    <td><%= product.history %></td>
    <td><%= product.quantity %></td>
    <td><%= product.cockpitCost %></td>
    <td><%= product.sellerCost %></td>
    <td><%= link_to 'Show', product %></td>
    <td><%= link_to 'Edit', edit_product_path(product) %></td>
    <td><%= link_to 'Destroy', product, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Product', new_product_path %>
